{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "6ada0858",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Copied JPG: frame_00003.jpg\n",
      "Copied JPG: frame_00005.jpg\n",
      "Copied JPG: frame_00006.jpg\n",
      "Copied JPG: frame_00007.jpg\n",
      "Copied JPG: frame_00008.jpg\n",
      "Copied JPG: frame_00009.jpg\n",
      "Copied JPG: frame_00010.jpg\n",
      "Copied JPG: frame_00017.jpg\n",
      "Copied JPG: frame_00020.jpg\n",
      "Copied JPG: frame_00021.jpg\n",
      "Copied JPG: frame_00022.jpg\n",
      "Copied JPG: frame_00023.jpg\n",
      "Copied JPG: frame_00025.jpg\n",
      "Copied JPG: frame_00026.jpg\n",
      "Copied JPG: frame_00027.jpg\n",
      "Copied JPG: frame_00029.jpg\n",
      "Copied JPG: frame_00030.jpg\n",
      "Copied JPG: frame_00032.jpg\n",
      "Copied JPG: frame_00033.jpg\n",
      "Copied JPG: frame_00034.jpg\n",
      "Copied JPG: frame_00036.jpg\n",
      "Copied JPG: frame_00038.jpg\n",
      "Copied JPG: frame_00044.jpg\n",
      "Copied JPG: frame_00046.jpg\n",
      "Copied JPG: frame_00047.jpg\n",
      "Copied JPG: frame_00048.jpg\n",
      "Copied JPG: frame_00054.jpg\n",
      "Copied JPG: frame_00055.jpg\n",
      "Copied JPG: frame_00056.jpg\n",
      "Copied JPG: frame_00057.jpg\n",
      "Copied JPG: frame_00058.jpg\n",
      "Copied JPG: frame_00059.jpg\n",
      "Copied JPG: frame_00060.jpg\n",
      "Copied JPG: frame_00062.jpg\n",
      "Copied JPG: frame_00064.jpg\n",
      "Copied JPG: frame_00065.jpg\n",
      "Copied JPG: frame_00067.jpg\n",
      "Copied JPG: frame_00071.jpg\n",
      "Copied JPG: frame_00075.jpg\n",
      "Copied JPG: frame_00078.jpg\n",
      "Copied JPG: frame_00079.jpg\n",
      "Copied JPG: frame_00081.jpg\n",
      "Copied JPG: frame_00083.jpg\n",
      "Copied JPG: frame_00084.jpg\n",
      "Copied JPG: frame_00086.jpg\n",
      "Copied JPG: frame_00088.jpg\n",
      "Copied JPG: frame_00089.jpg\n",
      "Copied JPG: frame_00091.jpg\n",
      "Copied JPG: frame_00093.jpg\n",
      "Copied JPG: frame_00094.jpg\n",
      "Copied JPG: frame_00098.jpg\n",
      "Copied JPG: frame_00099.jpg\n",
      "Copied JPG: frame_00103.jpg\n",
      "Copied JPG: frame_00104.jpg\n",
      "Copied JPG: frame_00105.jpg\n",
      "Copied JPG: frame_00106.jpg\n",
      "Copied JPG: frame_00107.jpg\n",
      "Copied JPG: frame_00108.jpg\n",
      "Copied JPG: frame_00110.jpg\n",
      "Copied JPG: frame_00113.jpg\n",
      "Copied JPG: frame_00114.jpg\n",
      "Copied JPG: frame_00116.jpg\n",
      "Copied JPG: frame_00118.jpg\n",
      "Copied JPG: frame_00119.jpg\n",
      "Copied JPG: frame_00121.jpg\n",
      "Copied JPG: frame_00123.jpg\n",
      "Copied JPG: frame_00134.jpg\n",
      "Copied JPG: frame_00137.jpg\n",
      "Copied JPG: frame_00139.jpg\n",
      "Copied JPG: frame_00142.jpg\n",
      "Copied JPG: frame_00143.jpg\n",
      "Copied JPG: frame_00145.jpg\n",
      "Copied JPG: frame_00146.jpg\n",
      "Copied JPG: frame_00147.jpg\n",
      "Copied JPG: frame_00156.jpg\n",
      "Copied JPG: frame_00158.jpg\n",
      "Copied JPG: frame_00161.jpg\n",
      "Copied JPG: frame_00162.jpg\n",
      "Copied JPG: frame_00164.jpg\n",
      "Copied JPG: frame_00168.jpg\n",
      "Copied JPG: frame_00170.jpg\n",
      "Copied JPG: frame_00172.jpg\n",
      "Copied JPG: frame_00173.jpg\n",
      "Copied JPG: frame_00175.jpg\n",
      "Copied JPG: frame_00182.jpg\n",
      "Copied JPG: frame_00184.jpg\n",
      "Copied JPG: frame_00189.jpg\n",
      "Copied JPG: frame_00193.jpg\n",
      "Copied JPG: frame_00195.jpg\n",
      "Copied JPG: frame_00196.jpg\n",
      "Copied JPG: frame_00202.jpg\n",
      "Copied JPG: frame_00204.jpg\n",
      "Copied JPG: frame_00208.jpg\n",
      "Copied JPG: frame_00210.jpg\n",
      "Copied JPG: frame_00212.jpg\n",
      "Copied JPG: frame_00215.jpg\n",
      "Copied JPG: frame_00219.jpg\n",
      "Copied JPG: frame_00220.jpg\n",
      "Copied JPG: frame_00221.jpg\n",
      "Copied JPG: frame_00222.jpg\n",
      "Copied JPG: frame_00224.jpg\n",
      "Copied JPG: frame_00229.jpg\n",
      "Copied JPG: frame_00231.jpg\n",
      "Copied JPG: frame_00232.jpg\n",
      "Copied JPG: frame_00234.jpg\n",
      "Copied JPG: frame_00237.jpg\n",
      "Copied JPG: frame_00239.jpg\n",
      "Copied JPG: frame_00241.jpg\n",
      "Copied JPG: frame_00245.jpg\n",
      "Copied JPG: frame_00249.jpg\n",
      "Copied JPG: frame_00250.jpg\n",
      "Copied JPG: frame_00254.jpg\n",
      "Copied JPG: frame_00257.jpg\n",
      "Copied JPG: frame_00258.jpg\n",
      "Copied JPG: frame_00259.jpg\n",
      "Copied JPG: frame_00262.jpg\n",
      "Copied JPG: frame_00263.jpg\n",
      "Copied JPG: frame_00268.jpg\n",
      "Copied JPG: frame_00269.jpg\n",
      "Copied JPG: frame_00271.jpg\n",
      "Copied JPG: frame_00274.jpg\n",
      "Copied JPG: frame_00275.jpg\n",
      "Copied JPG: frame_00277.jpg\n",
      "Copied JPG: frame_00278.jpg\n",
      "Copied JPG: frame_00282.jpg\n",
      "Copied JPG: frame_00283.jpg\n",
      "Copied JPG: frame_00284.jpg\n",
      "Copied JPG: frame_00285.jpg\n",
      "Copied JPG: frame_00287.jpg\n",
      "Copied JPG: frame_00289.jpg\n",
      "Copied JPG: frame_00292.jpg\n",
      "Copied JPG: frame_00295.jpg\n",
      "Copied JPG: frame_00299.jpg\n",
      "Copied JPG: frame_00302.jpg\n",
      "Copied JPG: frame_00304.jpg\n",
      "Copied JPG: frame_00305.jpg\n",
      "Copied JPG: frame_00310.jpg\n",
      "Copied JPG: frame_00312.jpg\n",
      "Copied JPG: frame_00313.jpg\n",
      "Copied JPG: frame_00315.jpg\n",
      "Copied JPG: frame_00317.jpg\n",
      "Copied JPG: frame_00320.jpg\n",
      "Copied JPG: frame_00321.jpg\n",
      "Copied JPG: frame_00322.jpg\n",
      "Copied JPG: frame_00324.jpg\n",
      "Copied JPG: frame_00327.jpg\n",
      "Copied JPG: frame_00329.jpg\n",
      "Copied JPG: frame_00330.jpg\n",
      "Copied JPG: frame_00332.jpg\n",
      "Copied JPG: frame_00335.jpg\n",
      "Copied JPG: frame_00337.jpg\n",
      "Copied JPG: frame_00338.jpg\n",
      "Copied JPG: frame_00341.jpg\n",
      "Copied JPG: frame_00342.jpg\n",
      "Copied JPG: frame_00343.jpg\n",
      "Copied JPG: frame_00345.jpg\n",
      "Copied JPG: frame_00346.jpg\n",
      "Copied JPG: frame_00347.jpg\n",
      "Copied JPG: frame_00348.jpg\n",
      "Copied JPG: frame_00349.jpg\n",
      "Copied JPG: frame_00350.jpg\n",
      "Copied JPG: frame_00351.jpg\n",
      "Copied JPG: frame_00352.jpg\n",
      "Copied JPG: frame_00353.jpg\n",
      "Copied JPG: frame_00354.jpg\n",
      "Copied JPG: frame_00356.jpg\n",
      "Copied JPG: frame_00358.jpg\n",
      "Copied JPG: frame_00360.jpg\n",
      "Copied JPG: frame_00362.jpg\n",
      "Copied JPG: frame_00363.jpg\n",
      "Copied JPG: frame_00365.jpg\n",
      "Copied JPG: frame_00366.jpg\n",
      "Copied JPG: frame_00370.jpg\n",
      "Copied JPG: frame_00371.jpg\n",
      "Copied JPG: frame_00373.jpg\n",
      "Copied JPG: frame_00377.jpg\n",
      "Copied JPG: frame_00378.jpg\n",
      "Copied JPG: frame_00380.jpg\n",
      "Copied JPG: frame_00383.jpg\n",
      "Copied JPG: frame_00384.jpg\n",
      "Copied JPG: frame_00385.jpg\n",
      "Copied JPG: frame_00387.jpg\n",
      "Copied JPG: frame_00389.jpg\n",
      "Copied JPG: frame_00391.jpg\n",
      "Copied JPG: frame_00395.jpg\n",
      "Copied JPG: frame_00398.jpg\n",
      "Copied JPG: frame_00399.jpg\n",
      "Copied JPG: frame_00404.jpg\n",
      "Copied JPG: frame_00405.jpg\n",
      "Copied JPG: frame_00406.jpg\n",
      "Copied JPG: frame_00407.jpg\n",
      "Copied JPG: frame_00408.jpg\n",
      "Copied JPG: frame_00409.jpg\n",
      "Copied JPG: frame_00412.jpg\n",
      "Copied JPG: frame_00413.jpg\n",
      "Copied JPG: frame_00415.jpg\n",
      "Copied JPG: frame_00420.jpg\n",
      "Copied JPG: frame_00421.jpg\n",
      "Copied JPG: frame_00423.jpg\n",
      "Copied JPG: frame_00428.jpg\n",
      "Copied JPG: frame_00431.jpg\n",
      "Copied JPG: frame_00432.jpg\n",
      "Copied JPG: frame_00434.jpg\n",
      "Copied JPG: frame_00436.jpg\n",
      "Copied JPG: frame_00442.jpg\n",
      "Copied JPG: frame_00443.jpg\n",
      "Copied JPG: frame_00444.jpg\n",
      "Copied JPG: frame_00446.jpg\n",
      "Copied JPG: frame_00447.jpg\n",
      "Copied JPG: frame_00449.jpg\n",
      "Copied JPG: frame_00451.jpg\n",
      "Copied JPG: frame_00454.jpg\n",
      "Copied JPG: frame_00455.jpg\n",
      "Copied JPG: frame_00457.jpg\n",
      "Copied JPG: frame_00459.jpg\n",
      "Copied JPG: frame_00460.jpg\n",
      "Copied JPG: frame_00461.jpg\n",
      "Copied JPG: frame_00465.jpg\n",
      "Copied JPG: frame_00466.jpg\n",
      "Copied JPG: frame_00469.jpg\n",
      "Copied JPG: frame_00471.jpg\n",
      "Copied JPG: frame_00474.jpg\n",
      "Copied JPG: frame_00476.jpg\n",
      "Copied JPG: frame_00482.jpg\n",
      "Copied JPG: frame_00483.jpg\n",
      "Copied JPG: frame_00484.jpg\n",
      "Copied JPG: frame_00486.jpg\n",
      "Copied JPG: frame_00490.jpg\n",
      "Copied JPG: frame_00493.jpg\n",
      "Copied JPG: frame_00496.jpg\n",
      "Copied JPG: frame_00498.jpg\n",
      "Copied JPG: frame_00499.jpg\n",
      "Copied JPG: frame_00501.jpg\n",
      "Copied JPG: frame_00504.jpg\n",
      "Copied JPG: frame_00506.jpg\n",
      "Copied JPG: frame_00507.jpg\n",
      "Copied JPG: frame_00508.jpg\n",
      "Copied JPG: frame_00509.jpg\n",
      "Copied JPG: frame_00510.jpg\n",
      "Copied JPG: frame_00511.jpg\n",
      "Copied JPG: frame_00512.jpg\n",
      "Copied JPG: frame_00513.jpg\n",
      "Copied JPG: frame_00514.jpg\n",
      "Copied JPG: frame_00515.jpg\n",
      "Copied JPG: frame_00516.jpg\n",
      "Copied JPG: frame_00517.jpg\n",
      "Copied JPG: frame_00518.jpg\n",
      "Copied JPG: frame_00519.jpg\n",
      "Copied JPG: frame_00520.jpg\n",
      "Copied JPG: frame_00521.jpg\n",
      "Copied JPG: frame_00522.jpg\n",
      "Copied JPG: frame_00523.jpg\n",
      "Copied JPG: frame_00524.jpg\n",
      "Copied JPG: frame_00525.jpg\n",
      "Copied JPG: frame_00526.jpg\n",
      "Copied JPG: frame_00527.jpg\n",
      "Copied JPG: frame_00528.jpg\n",
      "Copied JPG: frame_00529.jpg\n",
      "Copied JPG: frame_00530.jpg\n",
      "Copied JPG: frame_00531.jpg\n",
      "Copied JPG: frame_00532.jpg\n",
      "Copied JPG: frame_00533.jpg\n",
      "Copied JPG: frame_00534.jpg\n",
      "Copied JPG: frame_00535.jpg\n",
      "Copied JPG: frame_00536.jpg\n",
      "Copied JPG: frame_00537.jpg\n",
      "Copied JPG: frame_00538.jpg\n",
      "Copied JPG: frame_00539.jpg\n",
      "Copied JPG: frame_00540.jpg\n",
      "Copied JPG: frame_00541.jpg\n",
      "Copied JPG: frame_00542.jpg\n",
      "Copied JPG: frame_00544.jpg\n",
      "Copied JPG: frame_00548.jpg\n",
      "Copied JPG: frame_00549.jpg\n",
      "Copied JPG: frame_00550.jpg\n",
      "Copied JPG: frame_00554.jpg\n",
      "Copied JPG: frame_00557.jpg\n",
      "Copied JPG: frame_00558.jpg\n",
      "Copied JPG: frame_00560.jpg\n",
      "Copied JPG: frame_00561.jpg\n",
      "Copied JPG: frame_00564.jpg\n",
      "Copied JPG: frame_00567.jpg\n",
      "Copied JPG: frame_00568.jpg\n",
      "Copied JPG: frame_00570.jpg\n",
      "Copied JPG: frame_00572.jpg\n",
      "Copied JPG: frame_00576.jpg\n",
      "Copied JPG: frame_00579.jpg\n",
      "Copied JPG: frame_00580.jpg\n",
      "Copied JPG: frame_00581.jpg\n",
      "Copied JPG: frame_00582.jpg\n",
      "Copied JPG: frame_00585.jpg\n",
      "Copied JPG: frame_00586.jpg\n",
      "Copied JPG: frame_00588.jpg\n",
      "Copied JPG: frame_00590.jpg\n",
      "Copied JPG: frame_00595.jpg\n",
      "Copied JPG: frame_00596.jpg\n",
      "Copied JPG: frame_00597.jpg\n",
      "Copied JPG: frame_00598.jpg\n",
      "Copied JPG: frame_00599.jpg\n",
      "Copied JPG: frame_00600.jpg\n",
      "Copied JPG: frame_00601.jpg\n",
      "Copied JPG: frame_00602.jpg\n",
      "Copied JPG: frame_00603.jpg\n",
      "Copied JPG: frame_00604.jpg\n",
      "Copied JPG: frame_00605.jpg\n",
      "Copied JPG: frame_00606.jpg\n",
      "Copied JPG: frame_00607.jpg\n",
      "Copied JPG: frame_00608.jpg\n",
      "Copied JPG: frame_00609.jpg\n",
      "Copied JPG: frame_00610.jpg\n",
      "Copied JPG: frame_00611.jpg\n",
      "Copied JPG: frame_00612.jpg\n",
      "Copied JPG: frame_00613.jpg\n",
      "Copied JPG: frame_00615.jpg\n",
      "Copied JPG: frame_00616.jpg\n",
      "Copied JPG: frame_00617.jpg\n",
      "Copied JPG: frame_00619.jpg\n",
      "Copied JPG: frame_00620.jpg\n",
      "Copied JPG: frame_00622.jpg\n",
      "Copied JPG: frame_00623.jpg\n",
      "Copied JPG: frame_00624.jpg\n",
      "Copied JPG: frame_00625.jpg\n",
      "Copied JPG: frame_00626.jpg\n",
      "Copied JPG: frame_00627.jpg\n",
      "Copied JPG: frame_00628.jpg\n",
      "Copied JPG: frame_00629.jpg\n",
      "Copied JPG: frame_00630.jpg\n",
      "Copied JPG: frame_00631.jpg\n",
      "Copied JPG: frame_00633.jpg\n",
      "Copied JPG: frame_00635.jpg\n",
      "Copied JPG: frame_00642.jpg\n",
      "Copied JPG: frame_00643.jpg\n",
      "Copied JPG: frame_00644.jpg\n",
      "Copied JPG: frame_00645.jpg\n",
      "Copied JPG: frame_00646.jpg\n",
      "Copied JPG: frame_00648.jpg\n",
      "Copied JPG: frame_00651.jpg\n",
      "Copied JPG: frame_00652.jpg\n",
      "Copied JPG: frame_00653.jpg\n",
      "Copied JPG: frame_00654.jpg\n",
      "Copied JPG: frame_00655.jpg\n",
      "Copied JPG: frame_00656.jpg\n",
      "Copied JPG: frame_00657.jpg\n",
      "Copied JPG: frame_00658.jpg\n",
      "Copied JPG: frame_00659.jpg\n",
      "Copied JPG: frame_00660.jpg\n",
      "Copied JPG: frame_00663.jpg\n",
      "Copied JPG: frame_00667.jpg\n",
      "Copied JPG: frame_00669.jpg\n",
      "Copied JPG: frame_00670.jpg\n",
      "Copied JPG: frame_00672.jpg\n",
      "Copied JPG: frame_00673.jpg\n",
      "Copied JPG: frame_00675.jpg\n",
      "Copied JPG: frame_00676.jpg\n",
      "Copied JPG: frame_00677.jpg\n",
      "Copied JPG: frame_00678.jpg\n",
      "Copied JPG: frame_00679.jpg\n",
      "Copied JPG: frame_00680.jpg\n",
      "Copied JPG: frame_00681.jpg\n",
      "Copied JPG: frame_00682.jpg\n",
      "Copied JPG: frame_00684.jpg\n",
      "Copied JPG: frame_00686.jpg\n",
      "Copied JPG: frame_00688.jpg\n",
      "Copied JPG: frame_00690.jpg\n",
      "Copied JPG: frame_00691.jpg\n",
      "Copied JPG: frame_00692.jpg\n",
      "Copied JPG: frame_00693.jpg\n",
      "Copied JPG: frame_00694.jpg\n",
      "Copied JPG: frame_00695.jpg\n",
      "Copied JPG: frame_00696.jpg\n",
      "Copied JPG: frame_00698.jpg\n",
      "Copied JPG: frame_00701.jpg\n",
      "Copied JPG: frame_00702.jpg\n",
      "Copied JPG: frame_00704.jpg\n",
      "Copied JPG: frame_00707.jpg\n",
      "Copied JPG: frame_00713.jpg\n",
      "Copied JPG: frame_00714.jpg\n",
      "Copied JPG: frame_00715.jpg\n",
      "Copied JPG: frame_00716.jpg\n",
      "Copied JPG: frame_00717.jpg\n",
      "Copied JPG: frame_00718.jpg\n",
      "Copied JPG: frame_00719.jpg\n",
      "Copied JPG: frame_00720.jpg\n",
      "Copied JPG: frame_00721.jpg\n",
      "Copied JPG: frame_00722.jpg\n",
      "Copied JPG: frame_00723.jpg\n",
      "Copied JPG: frame_00724.jpg\n",
      "Copied JPG: frame_00725.jpg\n",
      "Copied JPG: frame_00726.jpg\n",
      "Copied JPG: frame_00727.jpg\n",
      "Copied JPG: frame_00728.jpg\n",
      "Copied JPG: frame_00729.jpg\n",
      "Copied JPG: frame_00730.jpg\n",
      "Copied JPG: frame_00731.jpg\n",
      "Copied JPG: frame_00732.jpg\n",
      "Copied JPG: frame_00733.jpg\n",
      "Copied JPG: frame_00734.jpg\n",
      "Copied JPG: frame_00735.jpg\n",
      "Copied JPG: frame_00736.jpg\n",
      "Copied JPG: frame_00737.jpg\n",
      "Copied JPG: frame_00738.jpg\n",
      "Copied JPG: frame_00739.jpg\n",
      "Copied JPG: frame_00740.jpg\n",
      "Copied JPG: frame_00741.jpg\n",
      "Copied JPG: frame_00742.jpg\n",
      "Copied JPG: frame_00743.jpg\n",
      "Copied JPG: frame_00745.jpg\n",
      "Copied JPG: frame_00747.jpg\n",
      "Copied JPG: frame_00749.jpg\n",
      "Copied JPG: frame_00751.jpg\n",
      "Copied JPG: frame_00756.jpg\n",
      "Copied JPG: frame_00761.jpg\n",
      "Copied JPG: frame_00766.jpg\n",
      "Copied JPG: frame_00767.jpg\n",
      "Copied JPG: frame_00768.jpg\n",
      "Copied JPG: frame_00769.jpg\n",
      "Copied JPG: frame_00770.jpg\n",
      "Copied JPG: frame_00772.jpg\n",
      "Copied JPG: frame_00777.jpg\n",
      "Copied JPG: frame_00781.jpg\n",
      "Copied JPG: frame_00782.jpg\n",
      "Copied JPG: frame_00783.jpg\n",
      "Copied JPG: frame_00784.jpg\n",
      "Copied JPG: frame_00785.jpg\n",
      "Copied JPG: frame_00787.jpg\n",
      "Copied JPG: frame_00789.jpg\n",
      "Copied JPG: frame_00791.jpg\n",
      "Copied JPG: frame_00793.jpg\n",
      "Copied JPG: frame_00795.jpg\n",
      "Copied JPG: frame_00797.jpg\n",
      "Copied JPG: frame_00799.jpg\n",
      "Copied JPG: frame_00801.jpg\n",
      "Copied JPG: frame_00802.jpg\n",
      "Copied JPG: frame_00803.jpg\n",
      "Copied JPG: frame_00804.jpg\n",
      "Copied JPG: frame_00805.jpg\n",
      "Copied JPG: frame_00806.jpg\n",
      "Copied JPG: frame_00807.jpg\n",
      "Copied JPG: frame_00808.jpg\n",
      "Copied JPG: frame_00809.jpg\n",
      "Copied JPG: frame_00810.jpg\n",
      "Copied JPG: frame_00811.jpg\n",
      "Copied JPG: frame_00813.jpg\n",
      "Copied JPG: frame_00814.jpg\n",
      "Copied JPG: frame_00815.jpg\n",
      "Copied JPG: frame_00816.jpg\n",
      "Copied JPG: frame_00817.jpg\n",
      "Copied JPG: frame_00818.jpg\n",
      "Copied JPG: frame_00819.jpg\n",
      "Copied JPG: frame_00822.jpg\n",
      "Copied JPG: frame_00825.jpg\n",
      "Copied JPG: frame_00827.jpg\n",
      "Copied JPG: frame_00829.jpg\n",
      "Copied JPG: frame_00830.jpg\n",
      "Copied JPG: frame_00831.jpg\n",
      "Copied JPG: frame_00832.jpg\n",
      "Copied JPG: frame_00833.jpg\n",
      "Copied JPG: frame_00834.jpg\n",
      "Copied JPG: frame_00835.jpg\n",
      "成功处理459张图片!\n"
     ]
    }
   ],
   "source": [
    "from PIL import Image\n",
    "import os\n",
    "import shutil\n",
    "\n",
    "\n",
    "input_path=\"../../assets/image/tmp\" #原始图片文件夹\n",
    "save_path=\"../../assets/image/tmp1\" #保存图片的位置\n",
    "\n",
    "tot=0\n",
    "os.makedirs(save_path, exist_ok=True)\n",
    "for file in os.listdir(input_path):\n",
    "    tot+=1\n",
    "    file_path = os.path.join(input_path, file)\n",
    "    if file.endswith(\".bmp\"):\n",
    "        img = Image.open(input_path+f\"/{file}\")\n",
    "        img.save(save_path+f\"/{file.replace('.bmp', '.jpg')}\", quality=95)\n",
    "    elif file.lower().endswith((\".jpg\", \".jpeg\")):\n",
    "        new_filename = file  # 保持原名\n",
    "        shutil.copy2(file_path, os.path.join(save_path, new_filename))\n",
    "        print(f\"Copied JPG: {file}\")\n",
    "    # 如果是 PNG，直接复制到新文件夹\n",
    "    elif file.lower().endswith(\".png\"):\n",
    "        new_filename = file  # 保持原名\n",
    "        shutil.copy2(file_path, os.path.join(save_path, new_filename))\n",
    "        print(f\"Copied PNG: {file}\")\n",
    "print(f\"成功处理{tot}张图片!\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "yolo",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.23"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
